﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Besture.UI.Admin.Login"
    EnableEventValidation="false" Culture="zh-CN" %>

<%@ Import Namespace="Resources" %>
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>翔盛国旅网站管理系统</title>
    <meta name="description" content=""/>
    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
    <link rel="stylesheet" href="/Admin/Themes/Css/normalize.css"/>
    <link rel="stylesheet" href="/Admin/Themes/Css/common.css"/>
    <script type="text/javascript" src="/Admin/Themes/Js/modernizr-2.6.2.min.js"></script>
    <script type="text/javascript" src="/Admin/Themes/Js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="/Admin/PlugIn/artDialog4.1.7/artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="/Admin/PlugIn/artDialog4.1.7/plugins/iframeTools.js"></script>
    <script type="text/javascript" src="/Admin/Themes/Js/admin.js"></script>
    <style type="text/css">
        /*
 * 登录
 */
        html, body
        {
            height: 100%;
        }
        .wrap
        {
            height: 100%;
        }
        .login-wrap, .login-wrap-bg
        {
            width: 100%;
            height: 100%;
            overflow: hidden;
        }
        .img-responsive
        {
            max-width: 100%;
            height: auto;
        }
        .login-form-wrap
        {
            position: fixed;
            left: 50%;
            top: 50%;
            margin: -197px 0 0 -215px;
            width: 430px;
            height: 395px;
            border-radius: 5px;
            box-shadow: 0 0 5px #0075a1;
            background: url(/Admin/Themes/Images/bg-login-form.png) repeat;
        }
        
        .logo-login
        {
            margin-top: 40px;
            text-align: center;
        }
        .logo-login p
        {
            margin-bottom: 10px;
            font-size: 18px;
            font-weight: 700;
            color: #FFF;
            font-family: \5FAE\8F6F\96C5\9ED1;
        }
        
        .login-item
        {
            position: relative;
            width: 246px;
        }
        .login-item s
        {
            position: absolute;
            left: 7px;
            top: 10px;
        }
        .login-item input[type="text"], .login-item input[type="password"]
        {
            padding: 10px 10px 10px 36px;
            width: 200px;
            height: 20px;
            line-height: 20px;
            border: 0;
            background: url(/Admin/Themes/Images/bg-login-input.png) repeat;
            border-radius: 3px;
        }
        .login-item input[type="checkbox"]
        {
            margin-right: 5px;
            width: 13px;
            height: 13px;
            vertical-align: middle;
        }
        .login-form td
        {
            padding: 7px 10px;
        }
        .login-form-label
        {
            width: 100px;
            text-align: right;
            color: #FFF;
            font-size: 14px;
        }
        .login-rememberpwd
        {
            color: #FFF;
            font-size: 12px;
        }
        .login-submit
        {
            width: 136px;
            height: 36px;
            text-align: center;
            font-size: 14px;
            color: #FFF;
            letter-spacing: 5px;
            border: 1px solid #FFF;
            border-radius: 3px;
            background: none;
        }
        .login-error
        {
            font-size: 14px;
            color: #F00;
        }
    </style>
</head>
<body class="login">
    <!--[if lt IE 7]>
	<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
    <div class="wrap">
        <div class="login-wrap">
            <form id="aspnetForm" action="" runat="server">
            <div class="login-wrap-bg">
                <img class="img-responsive" src="/Admin/Themes/Images/bg-login.jpg" />
            </div>
            <div class="login-form-wrap">
                <div class="logo-login">
                    <img src="/Admin/Themes/Images/logo-login.png" width="159" height="35" alt="Anyforweb" /><br />
                    <p> 翔盛国旅网站管理系统</p>
                </div>
                <div class="login-form">
                    <table cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    <div class="login-error">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="login-form-label">
                                    <label>
                                        <%=BestureWeb.User_Name %></label>
                                </td>
                                <td>
                                    <div class="login-item">
                                        <s class="icon-login-name"></s>
                                        <asp:TextBox runat="server" ID="txtLoginName" name="login-name" CssClass="text required"
                                            Text=""></asp:TextBox>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="login-form-label">
                                    <label>
                                        <%=BestureWeb.Password %></label>
                                </td>
                                <td>
                                    <div class="login-item">
                                        <s class="icon-login-pwd"></s>
                                        <asp:TextBox runat="server" ID="txtPassword" CssClass="text required" name="login-pwd"
                                            TextMode="Password" Text=""></asp:TextBox>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    <div class="login-item login-rememberpwd">
                                        <asp:CheckBox ID="cbRemember" Text="记住用户名" runat="server" />
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    <div class="login-item">
                                        <asp:Button runat="server" CssClass="login-submit" ID="btnLogin" Text="登录" OnClientClick="return Login();" />
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            </form>
        </div>
    </div>
    <!-- //wrap -->
<%--    <script type="text/javascript" src="/Admin/Themes/Js/jquery-1.7.1.min.js"></script>--%>
    <script src="/Admin/Themes/Js/jquery.validate.js"></script>
    <!--<script type="text/javascript" src="/Admin/Themes/Js/common.js"></script>-->
    <script type="text/javascript">
        jQuery(document).ready(function($) {
            $("#aspnetForm").validate({
                errorPlacement: function(error, element) {
                    error.appendTo($(".login-error"));
                }
            });
        });

        var height = window.screen.height;
        var width = window.screen.width;
        var leftW = (width - 185) / 2;
        var topH = (height - 42) / 2;

        window.onload = function () {
            $("#loading").css("height", height + "px");
            $("#loadText").css("left", leftW + "px");
        };

        function Login() {
            var loginName = $("#<%=txtLoginName.ClientID %>").val();

            var password = $("#<%=txtPassword.ClientID %>").val();

            var rememberPwd;
            if ($("#<%=cbRemember.ClientID %>").attr("checked")) {
                rememberPwd = true;    
            } else {
                rememberPwd = false;
            }
            

            if (loginName == "" || password == "") {
                ShowError("<%=BestureWeb.Input_UserName_Password %>");
                return false;
            }
            $("#loading").show();
            $.ajax({
                type: "GET",
                url: "/Admin/Common/Login.aspx?loginName=" + loginName + "&password=" + password + "&rememberPwd=" + rememberPwd + "&" + Math.random(),
                success: function (msg) {
                    if (msg == "0") {
                        window.location.href = "<%=returnUrl %>";
                    }
                    else {
                        $("#loading").hide();
                        ShowError("<%=BestureWeb.Input_UserName_Password %>");
                    }
                }
            });
            return false;
        }
    </script>
</body>
</html>
